import request from "@/utils/request";

// 查询租客合同分页查询
export function listLesseeContract(query) {
  return request({
    url: "/enterprise/contract/lesseeContract/list",
    method: "get",
    params: query,
  });
}

// 租客来源列表查询
export function listLesseeSource(query) {
  return request({
    url: "/enterprise/contract/lesseeSource/list",
    method: "get",
    params: query,
  });
}

// 查询房屋设施集合
export function listApartmentFacilities(query) {
  return request({
    url: "/enterprise/apartment/facilities/list",
    method: "get",
    params: query,
  });
}

// 电子合同合同模板分页查询(不传分页数据,默认返回100条数据)
export function pageElectronicVisa(query) {
  console.log('query',query)
  return request({
    url: "/enterprise/contract/contractTemplate/electronicVisa/page",
    method: "get",
    params: query,
  });
}

// 新增租客合同
export function addLesseeContract(data) {
  return request({
    url: "/enterprise/contract/lesseeContract",
    method: "post",
    data,
  });
}

// 查看租客合同详情
export function getLesseeContract(id) {
  return request({
    url: "/enterprise/contract/lesseeContract/"+id,
    method: "get",
  });
}

// 获取租客合同详细信息及附属数据
export function getAllLesseeContract(id) {
  return request({
    url: "/enterprise/contract/lesseeContract/getAll/"+id,
    method: "get",
  });
}

// 获取预览电子合同内容链接
export function getPreviewUrl(data) {
  return request({
    url: "/enterprise/contract/lesseeContract/previewUrl",
    method: "post",
    data,
  });
}

// 上传确认合同
export function uploadContractImage(data) {
  return request({
    url: "/enterprise/contract/lesseeContract/uploadContractImage",
    method: "put",
    data,
  });
}

// 合同撤销
export function repealLesseeContract(data) {
  return request({
    url: "/enterprise/contract/lesseeContract/repeal",
    method: "put",
    data,
  });
}

// 重新发起
export function relaunchLesseeContract(data) {
  return request({
    url: "/enterprise/contract/lesseeContract/relaunch",
    method: "post",
    data,
  });
}

// 签署进度
export function signProgressList(query  ) {
  return request({
    url: "/enterprise/department/signProgress/list",
    method: "get",
    params: query,
  });
}


// 费用项目列表
export function listBillItem(query  ) {
  return request({
    url: "/enterprise/bill/item/list",
    method: "get",
    params: query,
  });
}

// 获取合同文本
export function exportLesseeContract(id) {
  return request({
    url: "/enterprise/contract/lesseeContract/export/"+id,
    method: "get",
  });
}

// 签署合同
export function signLesseeContract(data) {
  return request({
    url: "/enterprise/contract/lesseeContract/signing",
    method: "put",
    data,
  });
}

// 查询房屋租赁时间列表
export function listRentTime (houseId) {
  return request({
    url: "/enterprise/order/order/rentList/"+houseId,
    method: "get",
  });
}

// 查询房屋的业主属性,获取电子合同模板名称前缀
export function getTemplateNameByHouse(houseId) {
  return request({
    url: "/enterprise/contract/lesseeContract/getTemplateNameByHouse/"+houseId,
    method: "get",
  });
}
